<?php

class Pldkp_Form_Decorator_DivWrapper extends Zend_Form_Decorator_Abstract
{    
    protected $_defaultClass = 'input-large';
    
    protected $_specialClass = array(
        'Zend_Form_Element_Button'   => 'button-large',
        'Zend_Form_Element_Reset'    => 'button-large',
        'Zend_Form_Element_Submit'   => 'button-large',
        'Zend_Form_Element_Textarea' => 'input-textarea',
        'Zend_Form_Element_Checkbox' => 'input-checkbox',
        'Pldkp_Form_Element_MultiSelector' => 'input-multiselector',
    );
        
    
    public function render($content)
    {
        $element = $this->getElement();

        if (!$element) {
            return $content;
        }
        
        $elementClass = get_class($element);
        $styleClass = $this->_defaultClass;
        
        if (isset($this->_specialClass[$elementClass])) {
            $styleClass = $this->_specialClass[$elementClass];
        }
        
        return '<div class="' . $styleClass . '">' . $content . '</div>';
    }
}